package com.HomeWorkhsp.Chapter08.extends_.exercise;

/**
 * Enjoy programming!!!
 * Time: 2021/11/20 -  14:22
 */
public class Exercise01 {
    public static void main(String[] args) {
        C1 c = new C1();
    }
}

class A1 {
    public A1() {
        System.out.println("我是A类");
    }
}

class B1 extends A1 {
    public B1() {
        System.out.println("我是B类的无参构造器");
    }

    public B1(String name) {
        System.out.println(name + "我是B类的有参构造器");
    }
}

class C1 extends B1 {
    public C1() {
        this("hello");
        System.out.println("我是c类的无参构造器");
    }

    public C1(String name) {
        super("hahaha");
        System.out.println("我是c类的有参构造器");
    }
}
